<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@include file="/jsp/commons/header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>销售分析系统</title>
    <link rel="stylesheet" type="text/css" media="screen" href="${ctx }/resources/css/screen.css" />
    <%@ include file="/jsp/commons/meta.jsp"%>
    <script type="text/javascript">
        $(function(){
        	$("#login_form").validate({
                rules:{
                    loginId:{
                        required:true
                    }
                },
                messages:{
                    loginId:{
                        required:"<font color=red>请输入您注册时的账号</font>"
                    }
                
                },
                submitHandler: function(form) {
                    var options={
                        beforeSubmit: function(){
                            $('#submitBtn').attr("disabled", true);
                        },
                        success: function(data){
                            if (data=="no"){
                                $("#status").html("<font color='red'>您输入的账号不存在</font>");
                                $('#submitBtn').attr("disabled", false);
                            } else{
                                $("#tabs_loginId").hide();
                                $("h3").hide()
                                $("input").hide();
                                $("#status").hide();
                                $("#message").html("<font color='red'>您的申请已提交,请前往您的"+data+"邮箱查收</font>");                                  
                            } 
                        }
                    };
                    $(form).ajaxSubmit(options);
                }
            });
        })
    </script>
</head>
<body>
    <div id="login">
        <div id="loginlogo"></div>
        <div id="loginpanel">
            <div class="panel-h"></div>
            <div class="panel-c">
                <div class="panel-c-l">
                    <form action="${ctx}/user/getPassword.htm" method="POST" id="login_form">
                        <table cellpadding="0" cellspacing="0">
                            <tbody>
                                <tr>
                                    <td align="left" colspan="2"> 
                                        <div id="status"></div>
                                        <h3>忘记密码</h3>
                                    </td>
                                </tr> 
                                <tr>
                                    <td align="right"><div id="tabs_loginId">账号：</div></td><td align="left"><input type="text" name="loginId" id="txtUsername" class="login-text" /></td>
                                </tr> 
                                <tr>
                                    <td></td>
                                    <td align="left" colspan="2">
                                        <input type="submit" id="submitBtn" value="下一步" class="login-btn" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="2">
                                        <div id="message"></div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
                <div class="panel-c-r">
                    <p>请从左侧输入您注册时的邮箱</p>
                    <p>稍后系统会将您的密码发送到您的邮箱</p>
                    <p><a href="${ctx}/user/toLogin.htm">返回首页</a></p>
                </div>
            </div>
            <div class="panel-f"></div>
        </div>
        <div id="logincopyright">Copyright © 2012 迪士恩 </div>
    </div>
</body>
